package com.whut.coc.adapter.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @Description:
 * @Author: Zonghe Wang
 * @Date: 2025/6/22 14:30
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class PlayerDTO {
    private String tag;
    private String name;
    private Integer townHallLevel;
    private Integer townHallWeaponLevel;
    private Integer expLevel;
    private Integer trophies;
    private Integer bestTrophies;
    private Integer warStars;
    private Integer attackWins;
    private Integer defenseWins;
    private Integer builderHallLevel;
    private Integer builderBaseTrophies;
    private Integer bestBuilderBaseTrophies;
    private String role;
    private String warPreference;
    private Integer donations;
    private Integer donationsReceived;
    private Integer clanCapitalContributions;
    private Clan clan;
    private BuilderBaseLeague builderBaseLeague;
    private List<Achievement> achievements;
    private PlayerHouse playerHouse;
    private List<Label> labels;
    private List<Troop> troops;
    private List<Hero> heroes;
    private List<Equipment> heroEquipment;
    private List<Spell> spells;

    @Data
    public static class Clan {
        private String tag;
        private String name;
        private Integer clanLevel;
        private BadgeUrls badgeUrls;

        @Data
        public static class BadgeUrls {
            private String small;
            private String large;
            private String medium;
        }
    }

    @Data
    public static class BuilderBaseLeague {
        private Integer id;
        private String name;
    }

    @Data
    public static class Achievement {
        private String name;
        private Integer stars;
        private Integer value;
        private Integer target;
        private String info;
        private String completionInfo;
        private String village;
    }

    @Data
    public static class PlayerHouse {
        private List<Element> elements;

        @Data
        public static class Element {
            private String type;
            private Integer id;
        }
    }

    @Data
    public static class Label {
        private Integer id;
        private String name;
        private IconUrls iconUrls;

        @Data
        public static class IconUrls {
            private String small;
            private String medium;
        }
    }

    @Data
    public static class Troop {
        private String name;
        private Integer level;
        private Integer maxLevel;
        private String village;
    }

    @Data
    public static class Hero {
        private String name;
        private Integer level;
        private Integer maxLevel;
        private List<Equipment> equipment;
        private String village;
    }

    @Data
    public static class Equipment {
        private String name;
        private Integer level;
        private Integer maxLevel;
        private String village;
    }

    @Data
    public static class Spell {
        private String name;
        private Integer level;
        private Integer maxLevel;
        private String village;
    }
}
